package cn.yuli.commad.impl;

import cn.yuli.commad.Command;
/**
 * 宏命令对象，可以实现一组命令对象的使用
 * @author yuli
 *
 */
public class MacroCommand implements Command {
	Command[] commands;
	public MacroCommand(Command[] commands) {
		this.commands = commands;
	}
	@Override
	public void excute() {
		for (Command command : commands) {
			command.excute();
		}
	}

	@Override
	public void undo() {
		for (Command command : commands) {
			command.undo();
		}
	}

}
